{% load static %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <title>{% block title %}Patchwork{% endblock %} - Patchwork</title>
  <link rel="stylesheet" type="text/css" href="{% static "css/bootstrap.min.css" %}"/>
  <link rel="stylesheet" type="text/css" href="{% static "css/selectize.bootstrap3.css" %}"/>
  <link rel="stylesheet" type="text/css" href="{% static "css/style.css" %}"/>
  <script src="{% static "js/jquery-1.10.1.min.js" %}"></script>
  <script src="{% static "js/jquery.stickytableheaders.min.js" %}"></script>
  <script src="{% static "js/jquery.checkboxes-1.0.6.min.js" %}"></script>
  <!-- IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js">
    </script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.0.8/es5-shim.min.js"></script>
  <![endif]-->
  <script src="{% static "js/bootstrap.min.js" %}"></script>
  <script src="{% static "js/selectize.min.js" %}"></script>
  <script src="{% static "js/clipboard.min.js" %}"></script>
  <script>
   $(document).ready(function() {
       new Clipboard(document.querySelectorAll('button.btn-copy'));
   });
  </script>
{% block headers %}{% endblock %}
 </head>
 <body>
  <nav class="navbar navbar-inverse navbar-static-top">
   <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="{% url 'project-list' %}">Patchwork</a>
      <span class="navbar-subbrand">
        {% block heading %}{% if project %} {{project.name}}{% endif %}{% endblock %}
      </span>
    </div>
    <div class="collapse navbar-collapse" id="navbar-collapse">
{% block navbarmenu %}
{% if project %}
      <ul class="nav navbar-nav">
        <li class="{% block patch_active %}{% endblock %}">
          <a href="{% url 'patch-list' project_id=project.linkname %}">
            <span class="glyphicon glyphicon-file"></span>
            Patches
          </a>
        </li>
        <li class="{% block bundle_active %}{% endblock %}">
          <a href="{% url 'bundle-list' project_id=project.linkname %}">
            <span class="glyphicon glyphicon-gift"></span>
            Bundles
          </a>
        </li>
        <li class="{% block info_active %}{% endblock %}">
          <a href="{% url 'project-detail' project_id=project.linkname %}">
            <span class="glyphicon glyphicon-info-sign"></span>
            About this project
          </a>
        </li>
      </ul>
{% endif %}
{% endblock %}
     <ul class="nav navbar-nav navbar-right">
{% if user.is_authenticated %}
     <li class="dropdown">
       <a href="#" class="dropdown-toggle" data-toggle="dropdown">
         <span class="badge">{{ user.profile.n_todo_patches }}</span>
         <strong>{{ user.username }}</strong>&nbsp;<span class="caret"></span>
       </a>
       <ul class="dropdown-menu" role="menu">
         <li>
           <a href="{% url 'user-todos' %}">
             Reviews pending
             <span class="badge">{{ user.profile.n_todo_patches }}</span>
           </a>
         </li>
         <li>
           <a href="{% url 'user-bundles' %}">
             Bundles
           </a>
         </li>
         <li role="separator" class="divider"></li>
{% if user.is_staff %}
         <li><a href="{% url 'admin:index' %}">Administration</a></li>
{% endif %}
         <li><a href="{% url 'user-profile' %}">View profile</a></li>
         <li><a href="{% url 'auth_logout' %}">Logout</a></li>
       </ul>
     </li>
{% else %}
     <li><a href="{% url 'auth_login' %}">Login</a></li>
     <li><a href="{% url 'user-register' %}">Register</a></li>
     <li><a href="{% url 'mail-settings' %}">Mail settings</a></li>
{% endif %}
     </ul>
    </div>
   </div>
  </nav>
{% if messages %}
  <div id="messages">
  {% for message in messages %}
  {# TODO(stephenfin): Make use of message.tags when completely #}
  {# converted to django.contrib.messages #}
   <div class="message">{{ message }}</div>
  {% endfor %}
  </div>
{% endif %}
  <div class="container-fluid">
{% block body %}
{% endblock %}
  </div>
  <div id="footer">
   <a href="http://jk.ozlabs.org/projects/patchwork/">patchwork</a>
   patch tracking system | version {{version}} | <a
   href="{% url 'about' %}">about patchwork</a>
  </div>
 </body>
</html>
